//package com.weixin.project.Config;
//import com.weixin.project.Config.Interceptor.UserInterceptor;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
//
//@Configuration
//public class MvcConfig extends WebMvcConfigurationSupport {
//    @Value("${document.imagePath}")
//    private String IMAGE_PATH;
//    @Value("${document.jsonPath}")
//    private String JSON_PATH;

//    @Autowired
//    UserInterceptor userInterceptor;

//    /**
//     * 添加静态资源映射
//     */
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        if(Config.CURRENT_OS.equals(Config.WINDOWS)) {
//            registry.addResourceHandler("/images/**")
//                    .addResourceLocations("file:" + IMAGE_PATH + "\\");
//            registry.addResourceHandler("/json/**")
//                    .addResourceLocations("file:" + JSON_PATH + "\\");
//            super.addResourceHandlers(registry);
//        }
//        if(Config.CURRENT_OS.equals(Config.LINUX)){
//            registry.addResourceHandler("/images/**")
//                    .addResourceLocations("file:" + IMAGE_PATH + "/");
//            registry.addResourceHandler("/json/**")
//                    .addResourceLocations("file:" + JSON_PATH + "/");
//            super.addResourceHandlers(registry);
//        }
//    }

//    /**
//     * 添加拦截器
//     */
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(userInterceptor).addPathPatterns("/**");
//    }
//}
